Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Functions
Defining Your Own User Pane Functions /


MyUserPaneHitTestProc

NEW WITH THE APPEARANCE MANAGER

Returns the part code of the control that the point was in when the mouse-down event occurred.

The Control Manager declares the type for an application-defined user pane hit test function as follows:

typedef pascal ControlPartCode (*ControlUserPaneHitTestProc) (
                                 ControlHandle control,
                                 Point where);
The Control Manager defines the data type ControlUserPaneHitTestUPP to identify the universal procedure pointer for this application-defined function:

typedef UniversalProcPtr ControlUserPaneHitTestUPP;
You typically use the NewControlUserPaneHitTestProc macro like this:

ControlUserPaneHitTestUPP myControlUserPaneHitTestUPP;
myControlUserPaneHitTestUPP = NewControlUserPaneHitTestProc
(MyUserPaneHitTest);

You typically use the CallControlUserPaneHitTestProc macro like this:

CallControlUserPaneHitTestProc(myControlUserPaneHitTestUPP, control, where);

Here's how to declare the function MyUserPaneHitTestProc:

pascal ControlPartCode MyUserPaneHitTestProc (
                     ControlHandle control,
                     Point where);
control
A handle to the control in which the mouse-down event occurred.
where
The point, in a window's local coordinates, where the mouse-down event occurred.
function result
Returns the part code of the control where the mouse-down event occurred. If the point was not over a control, your function should return kControlNoPart.
DISCUSSION
Once you have created the function MyUserPaneHitTestProc, pass kControlUserPaneHitTestProcTag in the tagName parameter of SetControlData.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998